<%-- 
    Document   : content_account
    Created on : Dec 30, 2011, 11:52:49 PM
    Author     : Ngoc Linh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<c:if test="${requestScope.result == true}">
    <script type="text/javascript">
        $(function(){
            $('p.message').fadeIn('slow').delay(2000).fadeOut("slow", goIndex)
        });
        
        function goIndex(){
            document.location.href = 'home.do';
        }
    </script>
</c:if>

<div id="content-col">
    <h2 class="mem_header_title">Chỉnh sửa thông tin tài khoản</h2>
    <div id="mem_account">
        <form action="account.do" method="post" onsubmit="return checkValidValue();">
            <c:if test="${not empty requestScope.message}">
                <p class="message">
                    ${requestScope.message}
                </p>            
            </c:if>    
            <c:if test="${not empty sessionScope.taiKhoan}">
                <table class="table_fm" id="fm_signup">
                    <tbody>
                        <tr>
                            <td class="label">Họ tên đầy đủ</td>
                            <td class="value"><input type="text" value="${sessionScope.thongTinTaiKhoan.hoTen}" id="fullname" name="fullname">
                            </td>
                            <td id="invalid_name" class="error">&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="label">Giới tính</td>
                            <td class="value">
                                <select name="gender">
                                    <option value="Nam"
                                            <c:if test="${sessionScope.thongTinTaiKhoan.gioiTinh=='Nam'}">
                                                selected="selected"
                                            </c:if>
                                            >Nam
                                    </option>
                                    <option value="Nữ"
                                            <c:if test="${sessionScope.thongTinTaiKhoan.gioiTinh=='Nữ'}">
                                                selected="selected"
                                            </c:if>
                                            >Nữ
                                    </option>                                    
                                </select>
                            </td>
                            <td id="invalid_gender" class="error">&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="label">Ngày sinh</td>
                            <td class="value"><input type="text" class="date" id="birthday" name="birthday">
                            </td>
                            <td id="invalid_birthday" class="error">&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="label">Địa chỉ</td>
                            <td class="value"><input type="text" value="${sessionScope.thongTinTaiKhoan.diaChi}" id="address" name="address"></td>
                            <td id="invalid_address" class="error">&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="label">Địện thoại</td>
                            <td class="value"><input type="text" value="${sessionScope.thongTinTaiKhoan.soDienThoai}" id="telphone" name="fone"></td>
                            <td id="invalid_telphone" class="error">&nbsp;</td>
                        </tr>      
                        <tr>
                            <td class="label">Email</td>
                            <td class="value"><input type="text" value="${sessionScope.thongTinTaiKhoan.email}" id="email" name="email"></td>
                            <td id="invalid_email" class="error">&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="label">&nbsp;</td>
                            <td style="padding-top:10px;" class="value">
                                <input type="submit" value="Cập nhật" name="update_account" class="btn_cm_common btn_option" />
                                <input type="button" onclick="cancleReg();" value="Hủy bỏ" name="cancle" class="btn_cm_common btn_option" />
                            </td>
                            <td class="error">&nbsp;</td>
                        </tr>
                    </tbody>
                </table>
            </c:if>
        </form>        
    </div>
</div>
